//
//  WBNetWorkManager+Extensions.swift
//  微博
//
//  Created by hejinyin on 2017/9/9.
//  Copyright © 2017年 WangQiang. All rights reserved.
//

import Foundation
//MARK: =========== OAuth相关 ===========
extension WBNetWorkManager{
    
    func loadAccessToken(code:String ,compeletion:(_ isSuccess:Bool)->()) {
         let urlString = "https://api.weibo.com/oauth2/access_token"
        let params = ["client_id": WBAppKey,
                      "client_secret": WBAppSecret,
                      "grant_type": "authorization_code",
                      "code": code,
                      "redirect_uri": WBRedirectURI]
        
        POST(urlString, parameters: params) { (result, error) in
            
            
            compeletion(true)
        }
    }
}
